<template>
	<view>
		<view class="product">
			<view class="product-list">
				<view class="product-list-item" v-for="it in list" @click="rowClick(it)">
					<image :src="it.ProductImage + '?imageView2/1/w/300/h/300'" mode="aspectFill" class="product-list-item-img" ></image>
					<view class="product-list-item-r">
						<view class="product-list-item-r-title"> {{it.ProductName || ''}}</view>
						<view class="product-list-item-r-guige">
							规格: {{it.Specifications || ''}}
						</view>
						<view class="list-item-t">
							<image class="list_item-img" :src="it.user.head"
								@click.stop="toMixinIndex(1,{userId: it.user.id})"></image>
							<view class="list_item-header">
								<view class="list_item-header-h">
									<view class="list_item-header-h-l">
										<view class="list_item-header-h-name">
											{{it.user.nickname}}
											<image
												:src="ossUrl + `/static/setting/${it.user.sex === '女' ? '7' : '6'}.png`"
												mode=""></image>
						
						
										</view>
										<!-- <view class="list_item-header-h-address">
											<image :src="ossUrl + `/static/card/2.png`" mode=""></image>
											address
										</view> -->
									</view>
									
								</view>
								<view class="list_item-header-time">
									<text style="font-size: 22rpx;">{{it.user.PositioningCity || ''}}</text>
									<!-- 	<text style="margin-left: 30rpx;">{{$u.timeFormat(it.add_time, 'yyyy年mm月dd日')}}</text> -->
						
								</view>
							</view>
						</view>
						<view class="product-list-item-r-price">
							
							<span>￥{{it.TotalPrice || ''}}</span>
							<view>
								<u-tag :text="getOrderStatus(it.OrderStatus)" plain size="mini" type="warning" shape="circle"></u-tag>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		goodsstores_recommend,
		goodsDistribution,
		InformationUserInfo
	} from '@/common/http/api.js'
	export default {
		props:['list'],
		data(){
			return {
				userInfo: ''
			}
		},
		created() {
			InformationUserInfo().then(res=>{
				this.userInfo = res.data
			})
		},
		methods:{
			rowClick(it){
				uni.navigateTo({
					url:`/pagesA/shopping/detail?id=${it.ProductID}&type=3&business_card_id=&nickname=` + this.userInfo.nickname
				})
			},
			getOrderStatus(status) {
				// 0-待支付，1-待发货，2-已发货(不用)，3-运输中，4-已完成，5-退款申请中，6-退款拒绝，7-退款成功，8-介入中，9同意退货（输入运单号,10等待商家退款
				let OrderStatus = [{
						label: '待支付',
						value: 0
					},
					{
						label: '待发货',
						value: 1
					},
					{
						label: '已发货',
						value: 2
					},
					{
						label: '运输中',
						value: 3
					},
					{
						label: '已完成',
						value: 4
					},
					{
						label: '退款申请中',
						value: 5
					},
					{
						label: '退款拒绝',
						value: 6
					},
					{
						label: '退款成功',
						value: 7
					},
					{
						label: '介入中',
						value: 8
					},
					{
						label: '同意退货',
						value: 9
					},
					{
						label: '等待退款',
						value: 10
					}
				]
				let name = ''
				try {
					name = OrderStatus.find(i => i.value === status).label
				} catch (e) {
			
				}
				return name
			},
		}
	}
</script>

<style lang="scss" scoped>
	.product {
		width: 690rpx;
		margin: 0 auto;
		padding-top: 20rpx;
		.product-list {
			width: 100%;
			.product-list-item {
				width: 100%;
				display: flex;
				min-height: 300rpx;
				border-radius: 20rpx;
				background: #fff;
				box-shadow: 0rpx 0rpx 5rpx #F6F7F8; 
				margin-bottom: 20rpx;
				.product-list-item-img {
					width: 300rpx;
					height: 300rpx;
					border-top-left-radius: 20rpx;
					border-bottom-left-radius: 20rpx;
					margin-right: 20rpx; 
				}
				.product-list-item-r {
					min-width: 0;
					flex: 1;
					box-sizing: border-box;
					padding: 20rpx;
					.product-list-item-r-title {
						font-size: 28rpx;
						font-weight: bold;
						margin-bottom: 20rpx;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}
					.product-list-item-r-guige {
						width: fit-content;
						background: #F8F8F8;
						padding: 1rpx 18rpx;
						border-radius: 5rpx;
						font-size: 28rpx;
						color: #A1A0A3;
						margin-bottom: 20rpx; 
					}
					.product-list-item-r-price {
						font-size: 36rpx;
						color: #E7373A;
						
						display: flex;
						justify-content: space-between;
					}
					.product-list-item-r-num {
						display: flex;
						justify-content: space-between;
						font-size: 28rpx;
						margin-bottom: 20rpx;
					}
					.product-list-item-r-btn {
						display: flex;
						align-items: center;
						justify-content: space-around;
					}
					
				}
			}
		}
	}
	.list-item-t {
		display: flex;
		align-items: center;
		margin-bottom: 25rpx;
		
	}
	.list_item-img {
		width: 70rpx;
		height: 70rpx;
		border-radius: 50%;
	}
	
	.list_item-header {
		min-width: 0;
		flex: 1;
		margin-left: 28rpx;
	
		.list_item-header-h {
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;
	
			.list_item-header-h-l {
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-bottom: 0rpx;
	
				.list_item-header-h-name {
					display: flex;
					align-items: center;
					font-family: PingFang SC;
					font-weight: 400;
					font-size: 30rpx;
					margin-right: 35rpx;
	
					image {
						margin-left: 14rpx;
						width: 26rpx;
						height: 26rpx;
					}
				}
	
				.list_item-header-h-address {
					display: flex;
					align-items: center;
					font-family: PingFang SC;
					font-weight: 300;
					font-size: 24rpx;
					color: #7A7A7A;
	
					image {
						margin-right: 10rpx;
						width: 30rpx;
						height: 30rpx;
					}
				}
			}
	
			.list_item-header-h-r {
				padding: 12rpx 18rpx;
				font-family: PingFang SC;
				font-weight: 300;
				font-size: 24rpx;
				color: #999999;
				background: #F6F7F8;
			}
		}
	
		.list_item-header-time {
			font-family: PingFang SC;
			font-weight: 300;
			font-size: 22rpx;
			color: #999999;
			display: flex;
	
		}
	}
</style>